package com.zhuang.controller;

import com.zhuang.framework.context.ApplicationContext;
import com.zhuang.framework.context.support.ClassPathXmlApplicationContext;
import com.zhuang.service.UserService;

/**
 * @Classname UserController
 * @Description controller层
 * @Date 2021/4/1 15:32
 * @Created by dell
 */

public class UserController {
    public static void main(String[] args) throws Exception {
        //创建spring容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        //从IOC容器中获取UserService对象
        UserService userService = applicationContext.getBean("userService", UserService.class);
        //调用UserService对象的add方法
        userService.add();
    }
}
